package xyz.ieden.freemarker.servlet;

import xyz.ieden.freemarker.entity.User;

import java.util.List;

/**
 * Created by Gavin on 2017.09.09.
 */
public interface IUserServlet {

    /**
     * 通过 id 删除用户信息
     *
     * @param userId
     * @throws Throwable
     */
    void deleteUserById(Long userId);

    /**
     * 更新用户信息
     *
     * @param user
     * @throws Throwable
     */
    User updateUser(User user);

    /**
     * 保存用户信息
     *
     * @param user
     * @return
     * @throws Throwable
     */
    User saveUser(User user);

    /**
     * 通过 id 获取用户
     *
     * @param userId
     * @return
     * @throws Throwable
     */
    User getUserById(Long userId);

    /**
     * 获取所有的用户信息
     *
     * @return
     * @throws Throwable
     */
    List<User> getAllUser();
}
